﻿using System;
using SourceGrid;
using SourceGrid.Cells.Controllers;
using ZeBobo5.LibraryHelper.Core.Grid.Controllers;

namespace ZeBobo5.LibraryHelper.Core.Grid.Controllers
{
    public class ValueChangedController : ControllerBase
    {
        public static readonly ValueChangedController Default = new ValueChangedController();

        public override void OnValueChanged(CellContext sender, EventArgs e)
        {
            base.OnValueChanged(sender, e);
            if (sender.Grid is IValueChangedControllerEvent)
            {
                ((IValueChangedControllerEvent) sender.Grid).OnValueChangedEvent(sender);
            }
        }
    }
}